home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1984 June
/
1984-06.d64
/
castle dungeon64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
7KB
|
179 lines
0 gosub 5000:gosub1500:gosub200:gosub1000:gosub1100:gosub1300::gosub1010
1 gosub 1140
5 gosub 3000:gosub 4000:gosub 1500:ti$="000000"
7 gosub 20:goto 7
10 joy=0:jy=peek(56320):j2=15-(jyand15):onj2 goto11,12,12,13,13,13,13,14:return
11 joy=-40:return
12 joy=40:return
13 joy=-1:return
14 joy=1:return
20 gosub 10
25 get a$:ifa$="l" then gosub 491:levitate=-1
27 if ti$>"000300"then a$="your time ran out":goto 600
30 temp=peek(man+joy)-40:iftemp<0thenlevitate=0:goto170
40 on temp gosub 50,60,80,90,110,130,140,150,160:goto 170
50 gosub 220:joy=0:return
60 ifnotlevitatethenpokeman,blank:gosub125:a$="you fell into a pit":goto105
70 k=1:return
80 key=-1:poke1303,43:poke55575,1:gosub 401:return
90 gosub 320:if not swrd then a$="you lost to a beast":goto 600
100 gosub 360:return
105 gosub 220:fortd=1to200:next:goto 600
110 bomb=bomb-1:poke 1823+40*bomb,45:poke 56095+40*bomb,1:if bomb=0 then 500
120 return
125 gosub260:gosub220:fortd=1to200:return
130 return
140 if not key then gosub 220:joy=0:return
150 return
160 swrd=-1:gosub 401:poke 1423,49:poke55695,1:return
170 xh=0:poke man,blank:man=man+joy:poke man,figure:if k=1 then poke man,42:k=1
180 q=man-1024:y=int(q/40):x=(q-y*40)*8:ifx>255thenxh=int(x/256):x=x-xh*256
190 y=y*8+32:poke hxsprite,xh:poke lxsprite,x:poke ysprite,y:blank=32
195 ifk=1thenk=0:blank=42
196 return
200 for i=1to4:read no(1,i),dur(1,i):next
201 for i=1to7:read no(2,i),nl(2,i),dur(2,i):next
205 return
210 data 8,100,7,50,7,50,12,300,14
211 data 2,24,100,2,24,100,2,24,100,2,163,100,2,24,100,2,163,100,3,35
220 rem bump sound
230 poke h1,15:poke l1,10
240 poke volume,15:poke attdec,20:poke sustrel,5:poke wave,noise
250 for td=1to10:next:poke wave,noise-1:for td=1to2:next:return
260 rem falling sound
270 poke attdec,10:poke sustrel,10:poke volume ,15
280 for i=200 to 100 step-1
290 poke h1,i:poke h2,100:poke wave,triangle
300 for td=1to3:next:poke wave,triangle-1:for td=1to3:next:next i
310 return
320 rem lion sound
330 poke attdec,100:poke sustrel,100:poke volume,15
340 poke h1,2 :poke h2,10:poke wave,noise:fortd=1to1000:next:poke wave,noise-1
350 fortd=1to100:next:return
360 rem victory sound
370 poke attdec,100:poke sustrel,100:poke volume,15
380 fori= 1 to 4:poke h1,no(1,i):poke h2,100:poke wave,saw
390 for td=1 to dur(1,i):next:poke wave,saw-1:for td=1 to dur(1,i):next:next
400 return
401 poke attdec,14:poke sustrel,201
402 poke h1,120:poke wave,saw:fortd=1to100:next:pokewave,saw-1
403 for td=1to200:next:return
410 rem win sound and opening sound
420 pokevolume,15:poke attdec,17:poke sustrel,140
430 for i= 1to7:poke h2,no(2,i):poke h1,nl(2,i):poke wave ,saw
440 for td=1todur(2,i):next:pokewave,saw-1:fortd=1todur(2,i):next:next:return
450 rem lose sound
460 poke attdec,100:poke sustrel,120:poke volume,15
470 poke h1,4:poke l1,48:poke wave,saw:fortd=1to500:next:poke wave,saw-1
480 for td=1to400:next:poke h1,2:pokel1,24:pokewave,saw:fortd=1to900:next
485 pokewave,saw-1:for td=1to500:next:return
490 rem levitate sound
491 poke attdec,100:poke sustrel,250:poke volume,15
492 for a=10to20:for b=20 to27:poke h1,a+b:poke l1,40:poke wave,triangle
493 for td=1 to2 :next:poke wave,triangle-1:for td=1 to 1:next:next:next
494 return
500 poke53269,0:gosub 410:poke background,1:for td=1 to 2000:next
510 print"[147]":poke 251,50:print"[144]congratulations !"
520 print"you saved the castle"
530 goto 700
600 poke 53269,0:poke background,1:gosub 450:for td=1 to 2000:next
610 print"[147][144]"spc(((40-(len(a$)))/2))a$
620 print"you lost the castle!"
630 goto 710
700 poke251,0:fortd=1to1500:next:print"this time"
710 fortd=1to500:next:print" hit y for further adventures"
720 get ans$:ifans$=""then720
730 if ans$="y"then poke background,0:goto 5
740 poke251,0:end
1000 forl=679to703:reada:pokel,a:next:poke806,167:poke807,2:poke251,40:return
1010 printchr$(144)"[147] find the bombs hidden in the dungeon."
1020 print"don't fall into a pit or get eaten by "
1030 print"a beast. press the 'l' key for a "
1040 print" levitation spell. you have 3 minutes"
1050 print" to fulfill your quest."
1060 print:print:print" (hit button to begin)"
1065 gosub 10:if jy<>111 then 1065
1067 return
1070 data72,138,72,152,72,166,251,240,8,160,255,136,208,253,202
1080 data 208,248,104,168,104,170,104,76,202,241
1100 cm=14336:cs=53248:poke56334,peek(56334)and254:poke1,peek(1)and251
1110 fori=0to1023:pokecm+i,peek(cs+i):next
1120 fori=cm+320tocm+320+95:reada:pokei,abs(a-255):next
1130 poke1,peek(1)or4:poke56334,peek(56334)or1:return
1140 poke53272,(peek(53272)and240)or14
1150 return
1160 data247,227,246,193,215,247,235,235,255,34,34,34,255,68,68,68
1170 data255,231,195,129,129,131,199,255,255,191,95,64,90,186,255,255
1180 data191,121,112,1,0,135,55,115,255,239,247,231,195,195,231,255
1190 data255,255,255,255,255,255,255,255,255,255,255,129,129,255,255,255
1200 data255,255,255,255,255,255,255,255,255,253,251,247,143,207,175,255
1210 data191,121,112,1,0,135,55,115,255,255,231,0,0,231,255,255
1300 print chr$(147):poke background,0:poke brder,0
1305 read l,n:ifn=-1then gosub410:fortd=1to2500:next:return
1310 forj=0ton:reads:pokel+j,s:next:goto1305
1360 data1234,17,85,64,73,112,64,110,85,64,75,64,114,64,112,32,32,112,64,75
1370 data1274,16,93,32,32,107,64,115,74,64,73,32,93,32,93,32,32,107,64
1380 data1314,17,74,64,75,75,32,125,85,64,75,32,75,32,74,64,75,109,64,73
1420 data1393,20,114,64,73,73,32,110,85,73,110,85,64,73,112,64,75,85,64,73,85,73
1430 data 110
1440 data1433,20,93,32,93,93,32,93,93,93,93,93,64,73,107,64,32,93,32,93,93,93,93
1450 data1473,20,113,64,75,74,64,115,125,74,75,74,64,75,109,64,73,74,64,75,125
1455 data 74,75,-1,-1
1500 wave=54276:noise=129:triangle=17:vol=54296:sound=54272:attdec=54277
1505 background=53281:brder=53280:levitate=0:swrd=0:key=0:bomb=3:loin=44
1510 saw=33:sustrel=54278:h1=54273:h2=54272:figure=40:blank=32
1515 hxsprite=53264:lxsprite=53248:ysprite=53249:poke 53271,1:poke 53277,1
1517 poke 53269,1:fori=832to896:pokei,255:next:poke2040,13
1518 poke 53287,1:poke53275,1
1520 for i=sound to sound+28:pokei,0:next:poke volume,15:return
3000 i=49152:if peek(i+2)=216thensys49160:goto 3025
3010 read a:if a=256 thensys49160:goto 3025
3020 poke i,a:i=i+1:goto 3010
3025 fori=1024to1062:pokei,41:pokei+960,41:next
3027 fori=55296to56295:pokei,0:next:return
3030 data 1,0,216,255,255,255,40
3040 data 0,169,41,133,251,169,40
3050 data 133,253,169,4,133,252,133
3060 data 254,169,147,32,210,255,162
3070 data 0,160,0,169,41 ,145,253
3080 data 200,192,39,208,249,24,165
3090 data 253,105,40,133,253,144,2
3100 data 230,254,232,224,23,208,229
3110 data 160,0,169,4,145,251,169
3120 data 255,141,15,212,169,128,141
3130 data 18,212,173,27,212,41,3
3140 data 133,173,170,10,168,24,185
3150 data 0,192,101,251,133,170,185
3160 data 1,192,101,252,133,171,24
3170 data 185,0,192,101,170,133,253
3180 data 185,1,192,101,171,133,254
3190 data 160,0,177,253,201,41,208
3200 data 18,138,145,253,169,32,145
3210 data 170,165,253,133,251,165,254
3220 data 133,252,76,62,192,232,138
3230 data 41,3,197,173,208,189,177
3240 data 251,170,169,32,145,251,224
3250 data 4,240,26,138,10,168,162
3260 data 2,56,165,251,249,0,192
3270 data 133,251,165,252,249,1,192
3280 data 133,252,202,208,238,76,62
3290 data 192,169,1,160,0,153,0
3300 data 216,153,0,217,153,0,218
3310 data 153,0,219,200,208,241,96,256
4000 rem character placements
4010 t=32:q=42:for i=1 to 7:gosub 4100:next
4020 q=44:for i=1 to 6:gosub 4100:next
4030 q=45:for i=1 to 3:gosub 4100:next
4040 q=43:for i=1 to 2:gosub 4100:next
4050 q=47:for i=1 to 5
4055 gosub 4100
4060 if(peek(place-40)<>32)or(peek(place+40)<>32)thenpokeplace,blank:goto4055
4070 next
4080 q=49:gosub 4100
4090 q=figure:gosub 4100:man=place
4095 t=41:q=32:fori=1to50:gosub 4100:next:return
4100 x=(rnd(1)*36+2):y=int(rnd(1)*20+3):pl=y*40+x+1024:ifpeek(place)<>tthen4100
4110 poke place,q:return
5000 print"[147]please wait"
5010 return